'use strict'
import {connect} from 'dva';
import React, {Component} from 'react';
import {withRouter} from 'react-router';
import CacheRoute from 'react-router-cache-route';
import ProductContent from "../../pages/ProduceContent/ProductContent";
import HomeCarousel from "../../pages/Home/HomeCarousel";
import ListProducts from "../../pages/Home/ListProducts";
import NavTop from "../../pages/Home/NavTop";
import TwoButton from "../../pages/Home/TwoButton";


const TOP = <div>
  {/*顶部导航栏*/}
  <NavTop/>

  {/*首页轮播图*/}
  <HomeCarousel/>

  {/*两个按钮*/}
  <TwoButton/>
</div>;

@withRouter
class IndexPage extends Component {

  render() {
    return (
      <div >
        {/*商品列表*/}
        <CacheRoute path="/home/list" component={({history}) => <ListProducts header={_ => TOP} history={history}/>}
                    extra/>
        <CacheRoute path="/home/product" component={ProductContent} extra/>
      </div>
    );
  }
}

IndexPage.propTypes = {};
const opts = () => {
  return {};
};
export default connect(opts)(IndexPage);
